package com.weds.data_sync.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * <p>
 * 脚本列表
 * </p>
 *
 * @author lhw
 * @since 2023-12-29
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "public.data_sync_script")
@Schema(name = "DataSyncScriptDO", description = "脚本列表")
public class DataSyncScriptDO {

    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "脚本名称")
    @TableField("script_name")
    private String scriptName;

    @Schema(description = "脚本描述")
    @TableField("script_desc")
    private String scriptDesc;

    @Schema(description = "模块所在路径")
    @TableField("module_path")
    private String modulePath;

    @Schema(description = "模块名")
    @TableField("module_name")
    private String moduleName;

    @Schema(description = "类名")
    @TableField("class_name")
    private String className;

    @Schema(description = "函数名")
    @TableField("func_name")
    private String funcName;

    @Schema(description = "函数参数")
    @TableField("func_param")
    private String funcParam;

    @Schema(description = "源码存储类型： 1 文件 2 文本内容")
    @TableField("save_type")
    private Integer saveType;

    @Schema(description = "脚本上下文命令: python,node等")
    @TableField("source_context")
    private String sourceContext;

    @Schema(description = "脚本前置命令")
    @TableField("prefix_cmd")
    private String prefixCmd;

    @Schema(description = "脚本后置命令")
    @TableField("suffix_cmd")
    private String suffixCmd;

    @Schema(description = "源码类型: 1 py 2 js")
    @TableField("source_type")
    private Integer sourceType;

    @Schema(description = "脚本源码")
    @TableField("source_code")
    private String sourceCode;

    @Schema(description = "脚本文件")
    @TableField(value = "script_file")
    private byte[] scriptFile;

    @Schema(description = "执行方式:1 rest 2 native")
    @TableField("run_type")
    private Integer runType;

    @Schema(description = "启用状态")
    @TableField("use_status_id")
    private Integer useStatusId;

    @Schema(description = "删除状态")
    @TableField("is_delete")
    private Integer isDelete;

    @Schema(description = "备注")
    @TableField("remark")
    private String remark;

    @Schema(description = "创建时间")
    @TableField("ct_date")
    private LocalDateTime ctDate;

    @Schema(description = "修改时间")
    @TableField("lt_date")
    private LocalDateTime ltDate;

    @Schema(description = "创建用户id")
    @TableField("ct_user_id")
    private Integer ctUserId;

    @Schema(description = "修改用户id")
    @TableField("lt_user_id")
    private Integer ltUserId;
}
